<?php

sudo -s 后操作

// brew install nginx
// brew install php56
// brew install php72

// 切版本的时候
// brew link php72 —force
// brew link php56 —force

// brew services start php56
// brew services start php71

// phpinfo();
// If you need to have this software first in your PATH instead consider running:
//   echo 'export PATH="/usr/local/opt/php@5.6/bin:$PATH"' >> ~/.bash_profile
//   echo 'export PATH="/usr/local/opt/php@5.6/sbin:$PATH"' >> ~/.bash_profile

// bash-3.2# brew services list
Name  Status  User Plist
nginx stopped      
bash-3.2# brew services start nginx

bash-3.2# brew services disable nginx
brew services command:
    Integrates Homebrew formulae with macOS launchctl manager.

    [sudo] brew services list
    List all running services for the current user (or root)

    [sudo] brew services run formula|--all
    Run the service formula without starting at login (or boot).

    [sudo] brew services start formula|--all
    Start the service formula immediately and register it to launch at login (or boot).

    [sudo] brew services stop formula|--all
    Stop the service formula immediately and unregister it from launching at login (or boot).

    [sudo] brew services restart formula|--all
    Stop (if necessary) and start the service immediately and register it to launch at login (or boot).

    [sudo] brew services cleanup
    Remove all unused services.

    If sudo is passed, operate on /Library/LaunchDaemons (started at boot).
    Otherwise, operate on ~/Library/LaunchAgents (started at login).
bash-3.2# 


is a symlink belonging to php@5.6. You can unlink it:
  brew unlink php@5.6

To force the link and overwrite all conflicting files:
  brew link --overwrite php@7.1

To list all files that would be deleted:
  brew link --overwrite --dry-run php@7.1



/usr/local/etc/php/7.1/php.ini




php开机启动： http://www.php.cn/php-weizijiaocheng-394014.html

brew 使用： 
https://blog.csdn.net/qq_41234116/article/details/79366454
https://blog.csdn.net/qq_41234116/article/details/79366454


nginx 安装：

./configure --prefix=/usr/local/software/nginx --with-openssl=/usr/local/software/ --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-threads --with-stream --with-stream_ssl_module --with-http_slice_module  --with-http_v2_module

./configure --prefix=/usr/local/software/nginx 
--with-openssl --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-threads --with-stream --with-stream_ssl_module --with-http_slice_module  --with-http_v2_module

// --with-file-aio



7.1.23 编译安装

./configure --prefix=/usr/local/software/php71 --enable-fpm --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-mhash --with-openssl --with-zlib --with-bz2 --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-zlib --enable-mbstring --with-mcrypt --enable-sockets --with-iconv-dir --with-xsl --enable-zip --with-pcre-dir --with-pear --enable-session --enable-xml --with-freetype-dir --enable-gd-jis-conv --enable-inline-optimization --enable-shared --enable-bcmath --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-mbregex --enable-pcntl --with-xmlrpc --enable-exif --with-readline --with-recode --with-tidy -with-libedit


curl 安装：
/usr/local/software/php71/bin/phpize
./configure --with-php-config=/usr/local/software/php71/bin/php-config --with-curl=/usr/local/software/curl/ 
make && make install

swoole 安装：
/usr/local/software/php71/bin/phpize
./configure --with-php-config=/usr/local/software/php71/bin/php-config
make && make install


redis 安装：
/usr/local/software/php71/bin/phpize
./configure --with-php-config=/usr/local/software/php71/bin/php-config
make && make install



xdebug 安装：
zend_extension=xdebug.so

/usr/local/software/php71/lib/php/extensions/no-debug-non-zts-20160303/



5.6.38 编译安装

./configure --prefix=/usr/local/software/php56 --enable-fpm --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-mhash --with-openssl=/usr/local/opt/openssl@1.1/ --with-zlib --with-bz2 --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-zlib --enable-mbstring --with-mcrypt --enable-sockets --with-iconv-dir --with-xsl --enable-zip --with-pcre-dir --with-pear --enable-session --enable-xml --with-freetype-dir --enable-gd-jis-conv --enable-inline-optimization --enable-shared --enable-bcmath --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-mbregex --enable-pcntl --with-xmlrpc --enable-exif --with-readline --with-recode --with-tidy -with-libedit


curl 安装：
/usr/local/software/php56/bin/phpize
./configure --with-php-config=/usr/local/software/php56/bin/php-config --with-curl=/usr/local/software/curl/ 
make && make install

swoole 安装：
/usr/local/software/php56/bin/phpize
./configure --with-php-config=/usr/local/software/php56/bin/php-config
make && make install

